package com.yuandian.customer.perception.controller;

import com.yuandian.api.customer_perception.po.BasePortraitParams;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.customer.perception.service.IUnitPortraitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  单位画像
 * @author liXin
 * @description 单位画像
 * @date 2022/4/24
 * @module yd-khgz-api
 */
@Slf4j
@RestController
@Api(value = "单位画像", tags = "单位画像")
@RequestMapping("/unitPortrait")
public class UnitPortraitController {

    @Autowired
	IUnitPortraitService unitPortraitService;


    /**
     *  活跃操作员人数
     */
    @PostMapping("queryActiveOperationcount")
    @ApiOperation(value = "活跃操作员人数", notes = "活跃操作员人数")
    public R<Object> queryActiveOperationcount(@RequestBody BasePortraitParams params){
        return unitPortraitService.queryActiveOperationcount(params);
    }



    /**
     * 单位操作员办理排行(TOP5)
     */
    @PostMapping("queryOperatorBusinessProcessCountTop5")
    @ApiOperation(value = "单位操作员办理排行(TOP5)", notes = "单位操作员办理排行(TOP5)")
    public R<Object> queryOperatorBusinessProcessCountTop5(@RequestBody BasePortraitParams params){
        return unitPortraitService.queryOperatorBusinessProcessCountTop5(params);
    }

    /**
     * 单位操作员事项操作平均耗时排行(TOP5)
     */
    @PostMapping("queryOperatorBusinessProcessAvgTimeTop5")
    @ApiOperation(value = "单位操作员事项操作平均耗时排行(TOP5)", notes = "单位操作员事项操作平均耗时排行(TOP5)")
    public R<Object> queryOperatorBusinessProcessAvgTimeTop5(@RequestBody BasePortraitParams params){
        return unitPortraitService.queryOperatorBusinessProcessAvgTimeTop5(params);
    }

    /**
     * 单位操作员活跃时段
     */
    @PostMapping("queryOperatorActiveDuration")
    @ApiOperation(value = "单位操作员活跃时段", notes = "单位操作员活跃时段")
    public R<Object> queryOperatorActiveDuration(@RequestBody BasePortraitParams params){
        return unitPortraitService.queryOperatorActiveDuration(params);
    }


    /**
     * 单位操作员活跃时段list
     */
    @PostMapping("queryOperatorActiveList")
    @ApiOperation(value = "单位操作员活跃时段list", notes = "单位操作员活跃时段list")
    public R<Object> queryOperatorActiveList(@RequestBody BasePortraitParams params){
        return unitPortraitService.queryOperatorActiveList(params);
    }

}
